<?php

App::uses('Category', 'Model');
$urlUsers = $this->Html->url(array('controller' => 'Users', 'action' => 'admin'));
$urlMoes = $this->Html->url(array('controller' => 'Moes', 'action' => 'admin'));
$urlRooms = $this->Html->url(array('controller' => 'Rooms', 'action' => 'admin'));
$urlChangePass = $this->Html->url(array('controller' => 'Users', 'action' => 'changePassForm'));
$urlLogout = $this->Html->url(array('controller' => 'Sesion', 'action' => 'logout'));
$urlMH = $this->Html->url(array('controller' => 'Teams', 'action' => 'index'));
$urlPP = $this->Html->url(array('controller' => 'Passports', 'action' => 'index'));
$urlVP = $this->Html->url(array('controller' => 'Checker', 'action' => 'index'));
$urlScheduler = $this->Html->url(array('controller' => 'TestScheduler', 'action' => 'admin'));
$urlQuestions = $this->Html->url(array('controller' => 'Questions', 'action' => 'admin', '0'));
$urlLastCreateCertifications = $this->Html->url(array('controller' => 'Certifications', 'action' => 'getLast'));
$urlLastDestroyCertifications = $this->Html->url(array('controller' => 'Certifications', 'action' => 'getLastDestroy'));
$urlRegisteredTrainments = $this->Html->url(array('controller' => 'TestRegister', 'action' => 'registered'));
$urlReportCertifications = $this->Html->url(array('controller' => 'Reports', 'action' => 'certifications'));
$urlNextToEnd = $this->Html->url(array('controller' => 'Trainings', 'action' => 'admin'));
$urlNextToExpire = $this->Html->url(array('controller' => 'Certifications', 'action' => 'admin'));
$urlUndated = $this->Html->url(array('controller' => 'Attempts', 'action' => 'undated'));
$urlKardex = $this->Html->url(array('controller' => 'Kardex', 'action' => 'admin'));
$urlRol = $this->Html->url(array('controller' => 'ShiftModels', 'action' => 'admin'));
$urlControlPassports = $this->Html->url(array('controller' => 'Passports', 'action' => 'control'));
$urlPhotosUser = $this->Html->url(array('controller' => 'Users', 'action' => 'usersPhotos'));
$name = $authUser['full_name'];
$nom = $authUser['nomina'];
?>
<ul class="nav navbar-nav navbar-left">
    <li>
        <a href="<?php echo $this->Html->url('/'); ?>">
            Entrena<span class="kaushan">Te!</span>
        </a>
    </li>
    <!--    Menu usuarios-->
    <li class="dropdown">
        <a class="dropdown-toggle" aria-expanded="true" role="button" data-toggle="dropdown">
            <i class='fa fa-user'></i>
            <?php echo __('Usuarios'); ?>
            <span class="caret"></span>
        </a>
        <ul class="dropdown-menu" role="menu">
            <li>
                <a href="<?php echo $urlUsers; ?>">
                    <i class='fa fa-user'></i>
                    <?php echo __('Usuarios'); ?>
                </a>
            </li>
            <li>
                <a href="<?php echo $urlMH; ?>">
                    <i class='fa fa-users'></i>
                    <?php echo __('Equipos'); ?>
                </a>
            </li>
            <li>
                <a href="<?php echo $urlPhotosUser; ?>">
                    <i class='fa fa-users'></i>
                    <?php echo __('Subir fotos'); ?>
                </a>
            </li>
        </ul>
    </li>
    <!--    Fin menu usuarios-->
    <!--Inicio menu de cursos-->
    <li class="dropdown">
        <a class="dropdown-toggle" aria-expanded="true" role="button" data-toggle="dropdown">
            <i class='fa fa-graduation-cap'></i>
            <?php echo __('Cursos'); ?>
            <span class="caret"></span>
        </a>
        <ul class="dropdown-menu" role="menu">
            <li>
                <a href="<?php echo $urlScheduler; ?>">
                    <i class='fa fa-calendar'></i>
                    <?php echo __('Agendar cursos'); ?>
                </a>
            </li>
            <li>
                <a href="<?php echo $urlRegisteredTrainments; ?>">
                    <i class='fa fa-list-alt'></i>
                    <?php echo __('Registro de cursos'); ?>
                </a>
            </li>
        </ul>
    </li>
    <!--Fin menu cursos-->
    <!--    inicio menu certificaciones-->
    <li class="dropdown">
        <a class="dropdown-toggle" aria-expanded="true" role="button" data-toggle="dropdown">
            <i class='fa fa-certificate'></i>
            <?php echo __('Certificaciones'); ?>
            <span class="caret"></span>
        </a>
        <ul class="dropdown-menu" role="menu">
            <li>
                <a href="<?php echo $urlQuestions; ?>">
                    <i class='fa fa-question'></i>
                    <?php echo __('Evaluación de certificación'); ?>
                </a>
            </li>
            <?php if ($haveModifyEnd === true) { ?>
                <li>
                    <a href="<?php echo $urlNextToEnd; ?>">
                        <i class='fa fa-list-alt'></i>
                        <?php echo __('Extensión'); ?>
                    </a>
                </li>
            <?php } ?>
            <?php if ($haveModifyLife === true) { ?>
                <li>
                    <a href="<?php echo $urlNextToExpire; ?>">
                        <i class='fa fa-list-alt'></i>
                        <?php echo __('Modificar vigencia'); ?>
                    </a>
                </li>
            <?php } ?>
        </ul>
    </li>
    <!--    Fin menu certificaciones-->
    <!--    inicio menu herramientas-->
    <li class="dropdown">
        <a class="dropdown-toggle" aria-expanded="true" role="button" data-toggle="dropdown">
            <i class='fa fa-wrench'></i>
            <?php echo __('Herramientas'); ?>
            <span class="caret"></span>
        </a>
        <ul class="dropdown-menu" role="menu">
            <li>
                <a href="<?php echo $urlPP; ?>">
                    <i class='fa fa-credit-card'></i>
                    <?php echo __('Pasaporte'); ?>
                </a>
            </li>
            <li>
                <a href="<?php echo $urlVP; ?>">
                    <i class='fa fa-qrcode'></i>
                    <?php echo __('Verificador'); ?>
                </a>
            </li>
            <li>
                <a href="<?php echo $urlKardex; ?>">
                    <i class='fa fa-list-alt'></i>
                    <?php echo __('Kardex'); ?>
                </a>
            </li>
            <li>
                <a href="<?php echo $urlRol; ?>">
                    <i class='fa fa-send'></i>
                    <?php echo __('Rol de turnos'); ?>
                </a>
            </li>
            <li>
                <a href="<?php echo $urlTaxis; ?>">
                    <i class='fa fa-taxi'></i>
                    <?php echo __('Solicitudes de transporte'); ?>
                </a>
            </li>
        </ul>
    </li>
    <!--    fin menu herramientas-->
    <li class="dropdown">
        <a class="dropdown-toggle" aria-expanded="true" role="button" data-toggle="dropdown">
            <i class='fa fa-list-alt'></i>
            <?php echo __('Reportes'); ?>
            <span class="caret"></span>
        </a>
        <ul class="dropdown-menu" role="menu">
            <li>
                <a href="<?php echo $urlReportCertifications; ?>">
                    <i class='fa fa-list-alt'></i>
                    <?php echo __('Reporte de certificaciones'); ?>
                </a>
            </li>
            <li>
                <a href="<?php echo $urlLastCreateCertifications; ?>">
                    <i class='fa fa-list-alt'></i>
                    <?php echo __('Certificaciones creadas'); ?>
                </a>
            </li>
            <li>
                <a href="<?php echo $urlLastDestroyCertifications; ?>">
                    <i class='fa fa-list-alt'></i>
                    <?php echo __('Certificaciones eliminadas'); ?>
                </a>
            </li>
            <?php if ($haveModifyEnd === true) { ?>
                <li>
                    <?php $url = $this->Html->url(array('controller' => 'PorCaducar', 'action' => 'admin')); ?>
                    <a href="<?php echo $url; ?>">
                        <i class='fa fa-list-alt'></i>
                        <?php echo __('Extensión'); ?>
                    </a>
                </li>
            <?php } ?>
            <?php if ($haveModifyLife === true) { ?>
                <li>
                    <?php $url = $this->Html->url(array('controller' => 'PorExpirar', 'action' => 'admin')); ?>
                    <a href="<?php echo $url; ?>">
                        <i class='fa fa-dedent'></i>
                        <?php echo __('Modificar vigencia'); ?>
                    </a>
                </li>
            <?php } ?>
            <li>
                <a href="<?php echo $urlUndated; ?>">
                    <i class='fa fa-list-alt'></i>
                    <?php echo __('Reporte de cursos sin fecha'); ?>
                </a>
            </li>
        </ul>
    </li>
</ul>
<ul class="nav navbar-nav navbar-right">
    <li class="dropdown">
        <a class="dropdown-toggle" aria-expanded="true" role="button" data-toggle="dropdown" title="<?php echo $name; ?>">
            <?php echo $this->Html->image('workers/' . $nom . '.jpg', array('height' => '30px')); ?>
            <?php echo $nom; ?>
            <span class="caret"></span>
        </a>
        <ul class="dropdown-menu" role="menu">
            <li>
                <a href="<?php echo $urlChangePass; ?>">
                    <i class='fa fa-edit'></i>
                    <?php echo __('Cambiar contraseña'); ?>
                </a>
            </li>
            <li>
                <a href="<?php echo $urlLogout; ?>">
                    <i class='fa fa-sign-out'></i>
                    <?php echo __('Cerrar sesión'); ?>
                </a>
            </li>
        </ul>
    </li>
</ul>
